package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

@ApiModel(value = "ProValueCardPurchase", description = "储值卡购卡过程")
@Data
@ToString
public class ProValueCardPurchase {

	@ApiModelProperty("购买储值卡的会员卡号")
	private String vipCardNo;
	@ApiModelProperty("支付成功后的支付单号")
	private String payOrderNo;
	@ApiModelProperty("面值卡主表ID")
	private String valueCardMainId;
	@ApiModelProperty("购买数量")
	private String purchaseNumber;
	@ApiModelProperty("购买的门店号")
	private String storeNo;

	@ApiModelProperty(value = "过程返回id", hidden = true)
	private Integer messageId;
	@ApiModelProperty(value = "过程返回信息", hidden = true)
	private String message;
	@ApiModelProperty(value = "面值卡id", hidden = true)
	private String valueCardId;
	@ApiModelProperty(value = "储值卡号", hidden = true)
	private String valueCardNo;
	@ApiModelProperty(value = "储值金额", hidden = true)
	private String storedValueAmount;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
